package edu.zut.cs.network.Experiment7;
import java.util.Scanner;
import org.apache.log4j.*;

public class ConvertDecimalToBinary {
    private static Logger logger =  Logger.getLogger(ConvertDecimalToBinary.class);
    public static String convertDecimalToBinary(int value){
        String binaryStr = Integer.toBinaryString(value);
        return binaryStr;
    }
    public static void main(String[] args) {
        logger.info("请输入一个十制数：");
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        String binaryString = convertDecimalToBinary(num);
        logger.info("十进制数："+num+"转换二进制数为："+binaryString);
    }
}
